import request from '@/utils/request';

// 学员相关API
// 查询学员列表
export function listStudent(query) {
  return request({
    url: '/followUp/student/list',
    method: 'get',
    params: query
  });
}

// 任务管理相关API
// 查询任务列表
export function listTask(query) {
  return request({
    url: '/followUp/task/list',
    method: 'get',
    params: query
  });
}

// 查询任务详情
export function getTask(id) {
  return request({
    url: '/followUp/task/' + id,
    method: 'get'
  });
}

// 新增任务
export function addTask(data) {
  return request({
    url: '/followUp/task',
    method: 'post',
    data: data
  });
}

// 修改任务
export function updateTask(data) {
  return request({
    url: '/followUp/task',
    method: 'put',
    data: data
  });
}

// 删除任务
export function deleteTask(id) {
  return request({
    url: '/followUp/task/' + id,
    method: 'delete'
  });
}

// 完成任务
export function completeTask(id) {
  return request({
    url: '/followUp/task/complete/' + id,
    method: 'put'
  });
}

// 跟进历史相关API
// 查询跟进历史
export function listFollowUpHistory(query) {
  return request({
    url: '/followUp/history/list',
    method: 'get',
    params: query
  });
}

// 新增跟进记录
export function addFollowUpHistory(data) {
  return request({
    url: '/followUp/history',
    method: 'post',
    data: data
  });
}

// 通话记录相关API
// 查询通话记录
export function listCallLog(query) {
  return request({
    url: '/followUp/callLog/list',
    method: 'get',
    params: query
  });
}

// 短信记录相关API
// 查询短信记录
export function listSmsLog(query) {
  return request({
    url: '/followUp/smsLog/list',
    method: 'get',
    params: query
  });
}

// 邮件相关API
// 查询邮件记录
export function listEmail(query) {
  return request({
    url: '/followUp/email/list',
    method: 'get',
    params: query
  });
}

// 发送邮件
export function sendEmail(data) {
  return request({
    url: '/followUp/email/send',
    method: 'post',
    data: data
  });
}

// 模板库相关API
// 查询模板列表
export function listTemplate(query) {
  return request({
    url: '/followUp/template/list',
    method: 'get',
    params: query
  });
}

// 获取模板详情
export function getTemplate(id) {
  return request({
    url: '/followUp/template/' + id,
    method: 'get'
  });
}

// 新增模板
export function addTemplate(data) {
  return request({
    url: '/followUp/template',
    method: 'post',
    data: data
  });
}

// 修改模板
export function updateTemplate(data) {
  return request({
    url: '/followUp/template',
    method: 'put',
    data: data
  });
}

// 删除模板
export function deleteTemplate(id) {
  return request({
    url: '/followUp/template/' + id,
    method: 'delete'
  });
}